All Questions
39 questions
5votes
1answer
413views
Implementing a joint differential equation and eigenvalue solver
I've written a Python script to solve a system of coupled differential equations and then use the results to solve an eigenvalue problem. The full problem is: \$\frac{d^2}{dr^2} K(r) = \frac{K(r)}{r^2}...
8votes
2answers
476views
Correctly sum pixel values into bins of angle relative to center
A quick way to try to do this would be to use scipy.ndimage.map_coordinates, mapping radius to one axis of a rectangular array, and angle to the other, then summing along the radius axis. But, I think ...
5votes
2answers
227views
Srivastava multivariate Fox H function in MATLAB
I was trying to rewrite the Python code in MATLAB. The result is consistent. But, the MATLAB code is so slow. Any help would be appreciated. Ref python code link The MATLAB code written by me is as ...
3votes
1answer
101views
"Flattening" a 2D STM image by subtracting an Nth order polynomial without typing out all the terms for each N?
I have some scanning tunneling microscopy (STM) topography images that I need to flatten. I have found that for some data I need a 4th order polynomial, but in other cases a lower order works better. ...
8votes
2answers
528views
Fourier Series of a given function
This is a very simple code that expresses a function in terms of Trigonometric Fourier Series and generates a animation based on the harmonics. I would like to know some ways to improve the ...
1vote
1answer
69views
Fixing math library functions in Black-Scholes options pricing model
I've amended a code for the Black-Scholes formula for European pricing options found here at the bottom of the page and fixed the math functions accordingly. Unlike the code on the website, mine has ...
9votes
1answer
4kviews
2votes
2answers
2kviews
Solving the TDoA multilateration problem in 3-dimensions
Background. I've written an algorithm to solve the Time Difference of Arrival (TDoA) multilateration problem in 3-dimensions. That is, given the known coordinates of ...
2votes
1answer
241views
Integration loop over multiple doping and temperature levels
I want to perform some calculations on a large dataset. The code can be found below, where I want to calculate the values for 'results_nr' over a large loop (1000 x 910) values. Can you help me out ...
2votes
2answers
1kviews
Applying Minimum Image Convention in Python
I am computing pairwise Euclidean distances for 3-D vectors representing particle positions in a periodic system. The minimum image convention is applied for each periodic boundary such that a ...
5votes
1answer
202views
compare between two labels /objects -dominance rules
I have a function dominates() that seems to be the bottleneck of my algorithm (after profiling it). the function is as follows: ...
1vote
1answer
296views
Reduce one for loop to decrease time complexity
I'm using NumPy to find out langrage polynomial interpolation. I'm using 2 for loop to find out langrage polynomial, but I want to reduce 2nd for loop so that my code time complexity can be less. Can ...
1vote
1answer
1kviews
What would be the computationally faster way to implement this 2D numerical integration?
I am interested in doing a 2D numerical integration. Right now I am using the scipy.integrate.dblquad but it is very slow. Please see the code below. My need is to ...
3votes
1answer
91views
Python Implementation of Canopy Structural Dynamic Model using scipy.optimize.least_squares
I am using the least_squares() function from the scipy.optimize module to calibrate a Canopy structural dynamic model (CSDM). ...
3votes
1answer
288views
Optical dispersion calculation from spectrograms with Python
First, I'd like to provide a little explanation on what my code is supposed to do. It is part of a middle-sized project. I restructured the code to work on its own, and also added little comments to ...